<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title> eBlog- 主页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link rel="shortcut icon" href="assets/manager/favicon.ico"> 
    <link href="assets/manager/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="assets/manager/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="assets/manager/css/animate.css" rel="stylesheet">
    <link href="assets/manager/css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                                    <span class="block m-t-xs" style="font-size:20px;">
                                        <i><a href="/"><img src="assets/manager/img/logo.png" alt="logo" width="30" height="30"></a></i>
                                        <strong class="font-bold">——Blog</strong>
                                    </span>
                                </span>
                            </a>
                        </div>
                        <div class="logo-element">eBlog
                        </div>
                    </li>
                    <li class="hidden-folded padder m-t m-b-sm text-muted text-xs">
                        <span class="ng-scope">分类</span>
                    </li>
                    <li>
                        <a class="J_menuItem" href="mgmain"> 
                            <i class="fa fa-home"></i>
                            <span class="nav-label">主页</span>
                        </a>
                    </li>
                    <shiro:hasRole name="admin">
                    <li>
                        <a class="J_menuItem" href="mgusers">
                            <i class="fa fa-cog"></i>
                            <span class="nav-label">用户管理</span>
                        </a>
                    </li>
                    <li>
                        <a class="J_menuItem" href="mgarticle">
                            <i class="fa fa-calendar-minus-o"></i>
                            <span class="nav-label">文章管理</span>
                        </a>
                    </li>
                    <li>
                        <a class="J_menuItem" href="mgtags">
                            <i class="fa fa-calendar-minus-o"></i>
                            <span class="nav-label">标签管理</span>
                        </a>
                    </li>
                    </shiro:hasRole>
                    <li>
                        <a class="J_menuItem" href="myarticle">
                            <i class="fa fa-building-o"></i>
                            <span class="nav-label">我的文章</span>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <i class="fa fa fa-male"></i>
                            <span class="nav-label">个人信息</span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a class="J_menuItem" href="userinfo">个人资料</a>
                            </li>
                            <li>
                                <a class="J_menuItem" href="userpic">头像修改</a>
                            </li>
                            <li>
                                <a class="J_menuItem" href="coverpic">主页封面</a>
                            </li>
                            <li>
                                <a class="J_menuItem" href="editpw">密码修改</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-info " href="#"><i class="fa fa-bars"></i> </a>
                        <form role="search" class="navbar-form-custom" method="post" action="search_results.html">
                            <div class="form-group">
                                <input type="text" placeholder="请输入您需要查找的内容 …" id="topSearch" class="form-control">
                            </div>
                        </form>
                    </div>
                    <ul class="nav navbar-top-links navbar-right outBox">
                        <li>你好，<img id="userPic" src="assets/manager/img/userpic.png" style="width:40px;height:40px;border-radius:50%;" alt="userpic">
                        <span><shiro:principal></shiro:principal></span>!&nbsp;&nbsp;&nbsp;&nbsp;
                        <button type="button" id="logout" class="btn btn-outline btn-info">退出</button></li>
                    </ul>
                </nav>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe id="J_iframe" width="100%" height="100%" src="mgmain" frameborder="0" data-id="mgmain.jsp" seamless></iframe>
            </div>
        </div>
        <!--右侧部分结束-->
    </div>

    <!-- 全局js -->
    <script src="assets/manager/js/jquery.min.js?v=2.1.4"></script>
    <script src="assets/manager/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="assets/manager/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="assets/manager/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="assets/manager/js/plugins/layer/layer.min.js"></script>
    <!-- 自定义js -->
    <script src="assets/manager/js/hAdmin.js?v=4.1.0"></script>
    <script type="text/javascript" src="assets/manager/js/index.js"></script>
    <!-- 第三方插件 -->
    <script src="assets/manager/js/plugins/pace/pace.min.js"></script>
    <script>
    	$(document).ready(function(){
    		$("#logout").click(function(){
    			$.get("logout",function(data){
    				if(data.res == true){
    					alert("欢迎再次光临。");
    					window.location.href='/';
    				}
    			})
    		});
    		$.get("mgindexgetuser",function(data){
    			$("#userPic").attr("src",data.userPic); 
    		});
    		
    		$(document).keydown(function(event){  
    		  	  if(event.keyCode == 13 || event.keyCode == 108){  
    		  		if($("#topSearch").focus){
    		  			return false;
    		  		}
    		  	  } 
    		  	}); 
    	});
    </script>
</body>
</html>